BEGIN TRANSACTION;  -- 开启事务‌:ml-citation{ref="3,5" data="citationList"}
BEGIN TRY
    -- 业务逻辑（如更新订单、库存）
    COMMIT TRANSACTION;  -- 成功则提交‌:ml-citation{ref="3,5" data="citationList"}
END TRY
BEGIN CATCH
    IF XACT_STATE() = -1 
        ROLLBACK TRANSACTION;  -- 失败则回滚‌:ml-citation{ref="3,7" data="citationList"}
    THROW;  -- 抛出异常供外部处理‌:ml-citation{ref="7" data="citationList"}
END CATCH;
